<div class="row">
<div class="col-md-9">
  <div id="notes" class="panel panel-default">
    <div class="panel-heading">
      我的记事本
      <span class="total pull-right">
      已有 <%= current_user.notes.count %> 条记事
      </span>
    </div>

    <div class="panel-body">
    <% if @notes.blank? %>
      <div style="text-align:center; padding:60px 0;">你还没有创建过一个文件。</div>
    <% else %>

      <div>
      <% @notes.each do |note| %>
        <div class="media">
          <div class="media-body">
            <div class="media-heading">
              <i class="fa fa-file-text-o"></i>
              <%= link_to note.display_title, note %>
              <% if note.publish %>
                <span class="label warning"><i class="fa fa-share-alt"></i> 公开</span>
              <% end %>
              <span class="opts pull-right">
                <a href="<%= edit_note_path(note.id) %>"><i class="fa fa-pencil"></i></a>
              </span>
            </div>
            <div class="info">
              <%= note.word_count %> <%= t("notes.chars") %>, <%= sanitize t("notes.created_at", time: timeago(note.created_at)) %>, <%= note.changes_count %> <%= t("notes.times_edit") %>
            </div>
          </div>
        </div>
      <% end %>
      </div>
    <% end %>
    </div>

    <div class="panel-footer">
      <%= will_paginate @notes %>
    </div>
  </div>
</div>

<%= render "sidebar" %>
</div>
